﻿<UserControl x:Class="StackHash.CollectionPolicyControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="MasterResources.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <TextBlock Margin="5,3,5,3" Grid.ColumnSpan="2" FontWeight="Bold" Name="textCabCollectionPolicy">Cab Collection Policy:</TextBlock>
        <CheckBox Margin="5,3,3,3" Grid.ColumnSpan="2" FontWeight="Bold" Name="checkBoxCabCollectionPolicy" Checked="checkBoxCabCollectionPolicy_Checked" Unchecked="checkBoxCabCollectionPolicy_Unchecked">_Set Cab Collection Policy:</CheckBox>

        <RadioButton Margin="5,3,3,3" Grid.Row="1" VerticalAlignment="Center" Name="radioButtonAll" Checked="radioButtonAll_Checked">Download _all cabs</RadioButton>
        <TextBox Margin="3" Grid.Row="1" Grid.Column="1" Visibility="Hidden" />

        <RadioButton Margin="5,3,3,3" Grid.Row="2" VerticalAlignment="Center" Name="radioButtonCount" Checked="radioButtonCount_Checked">Limit download (_number of cabs):</RadioButton>
        <TextBox Margin="3" Grid.Row="2" Grid.Column="1" Name="textBoxMaximum" Text="{Binding CabCount, Mode=TwoWay, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" ToolTip="{Binding ElementName=textBoxMaximum, Path=(Validation.Errors)[0].ErrorContent}" />

        <RadioButton Margin="5,3,3,3" Grid.Row="3" VerticalAlignment="Center" Name="radioButtonPercentage" Checked="radioButtonPercentage_Checked">Limit download (_percentage):</RadioButton>
        <TextBox Margin="3" Grid.Row="3" Grid.Column="1" Name="textBoxPercentage" Text="{Binding CabPercentage, Mode=TwoWay, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" ToolTip="{Binding ElementName=textBoxPercentage, Path=(Validation.Errors)[0].ErrorContent}" />

        <RadioButton Margin="5,3,3,3" Grid.Row="4" VerticalAlignment="Center" Name="radioButtonNone" Checked="radioButtonNone_Checked">Do not _download cabs</RadioButton>
        <TextBox Margin="3" Grid.Row="4" Grid.Column="1" Visibility="Hidden" />

        <ComboBox Margin="5,3,5,3" Grid.Row="5" Grid.ColumnSpan="2" Name="comboBoxCollectionorder" ItemsSource="{Binding CollectionOrders}" SelectedItem="{Binding SelectedCollectionOrder, Mode=TwoWay}" />

        <CheckBox Margin="5,3,5,3" Grid.Row="6" Grid.ColumnSpan="2" Name="checkBoxDownloadLarger" IsChecked="{Binding CabCollectLarger, Mode=TwoWay}">Download _larger cabs, even if download limit is hit</CheckBox>
        
        <TextBlock Margin="5,10,5,3" Grid.Row="7" Grid.ColumnSpan="2" FontWeight="Bold" Name="textEventPolicy">Event Collection Policy:</TextBlock>
        <CheckBox Margin="5,10,5,3" Grid.Row="7" Grid.ColumnSpan="2" FontWeight="Bold" Name="checkBoxEventCollectionPolicy" Checked="checkBoxEventCollectionPolicy_Checked" Unchecked="checkBoxEventCollectionPolicy_Unchecked">Set _Event Collection Policy:</CheckBox>

        <Label Grid.Row="8" Target="{Binding ElementName=textBoxEventHitThreshold}" Name="labelHitThreshold">_Hit threshold for cab collection:</Label>
        <TextBox Margin="3" Grid.Row="8" Grid.Column="1" Name="textBoxEventHitThreshold" Text="{Binding EventHitThreshold, Mode=TwoWay, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" ToolTip="{Binding ElementName=textBoxEventHitThreshold, Path=(Validation.Errors)[0].ErrorContent}" />

    </Grid>
</UserControl>
